# readme tuple
# 元祖创建语法 tuple = (元素1，元素2，元素3)
tuple1 = ('jack', 'tom', 'amy', 'sunny')
print(tuple1)
# 访问元祖
print(tuple1[1])
# 删除元祖，元祖的元素值不允许单独修改和删除，只能删除只能元祖
# del tuple1
# print(tuple1)
# 元祖截取
tuple2 = tuple1[0:2]
print(tuple2)
# 多维元祖，元祖中的一个元素可以是一个元祖
tuple3 = ('a1', tuple2, 'a2', 'a3')
print(tuple3)
print(len(tuple3))
print(tuple3[1][0])

# 元祖函数 len(tuple)  max(tuple)  min(tuple)  tuple(list)
print(len(tuple1))
print(max(tuple1))
print(min(tuple1))

list1=[1,2,3,4,5]
print(list1)
tuple5 = tuple(list1)
print(tuple5)